memory_alphafandomcom-20200223-history
Help:Piped link
A piped link is an internal or where the link target and link label are both specified. This is needed in the case that they are not equal, while also the link label is not equal to the link target with the last word extended. This allows linking a word or phrase within the text of a page rather than using "see also", even if the wording does not exactly correspond with the name of the target page. With a suitable and depending on the set, one can still see the link target: when you point at the link, the name shows up in a hover box and is also shown in the status bar. For instance: Scotty will display as Scotty. The term piped refers to the use of the pipe character "|" used to separate the desired display description from the actual link. This character is named after an alternative use of it; see . To create a piped link with a tooltip that is different than the link, use the template. For example, produces . See the linktip documentation for more information. Using a redirect as an alternative An alternative to piped links is simply using . To create Scotty, use Scotty and make this a redirect to Montgomery Scott (note that, unlike above, what pops up when you point at the link, if applicable for your browser, is simply the text already shown). This is convenient if the redirect is already there or will also be of use elsewhere; however, there are a few drawbacks: *the popup does not show the page one will arrive at *" " gives the changes in the redirect page not the redirect target *the redirect message on the target page clutters it slightly Automatic conversion of the wikitext Pipe trick If in a piped link the part after the "|" is left empty, it is to an abbreviated form of the page name on the left, as follows: #any word before the first colon (:), as well as the colon itself, is removed. This word may or may not be a namespace prefix (such as "Help:") or an interwiki prefix (such as "wikia:"). If the page name is preceded by a colon, "first" refers to "first after this". #if there is text in parentheses at the end it will be removed #if there are no parentheses but there is a comma, the comma and everything after it is removed Just like for the three or four tildes when signing on and the use of subst, in a preview, the result already shows up in the preview itself, but the conversion in the edit box is not yet shown. Press "Show changes" to see the change in the wikitext. Examples * is converted to , which is rendered as * Starwars: Wookiee is converted to Wookiee, which is rendered as Wookiee - although "Starwars:" is not a namespace (therefore the space after the colon is not automatically removed), the shortcut works anyway * wikipedia:en:Pipeline (Unix) is converted to en:Pipeline (Unix), which is rendered as en:Pipeline * commons:Boston, Massachusetts is converted to Boston, which is rendered as Boston *wikipedia: } does not give }, and calling the template with a value for parameter 1 gives a working link in the case of substitution only *wikipedia:en: does not give en: and m: does not give Thus, *project:a (b) *wikipedia:project:a (b) *de:project:a (b) *wiktionary:project:a (b) *wiktionary:de:project:a (b) *wikibooks:project:a (b) *wikiquote:project:a (b) *wikisource:project:a (b) *wikipedia:en: en: *m: produces *a *project:a *project:a *project:a *de:project:a *project:a *project:a *project:a *wikipedia:en: en: *m: Category tag Since the sortkey syntax of the category is like a piped link, the pipe trick also works for category tags, even though it is not useful there. Limitation * using is not converted, so the result is rendered as and not as a working link. This is because the pipe trick expansion, like substitution, occurs before ordinary expansion of templates, etc., while the pipe trick does not work if the linked page contains invalid characters. Thus, while ordinarily the acceptability of the target page name is judged after template expansion, the pipe trick expansion judges it before, and the braces are considered invalid characters in the page name. Instead, one can use a template like : k}} gives k}}. Inverse pipe trick On page "A ©", [[|b]] is automatically converted to b. Similarly, on page "A, c", [[|b]] is automatically converted to b. Syntax for external links For external links, a space is used instead of a pipe character; see . See also * * Clean linking at MetaWiki * , which shows how to abbreviate subpage names. (The pipe trick doesn't work as expected for subpages, which some people consider a bug.)